<template>
  <div style="background: #fff">
    <div><img src="../assets/fang.jpg" alt="" /></div>
    <p>打卡信息</p>
    <el-form :model="dkform" label-width="150px" class="firn">
      <el-form-item label="姓名" prop="name">
        <el-input v-model="dkform.name"></el-input>
      </el-form-item>
      <el-form-item label="位置" prop="currentPosition">
        <el-input v-model="dkform.currentPosition"></el-input>
      </el-form-item>
      <el-form-item label="健康状况" prop="healthState">
        <el-input v-model="dkform.healthState"></el-input>
      </el-form-item>
      <el-form-item label="体温" prop="bodyTemperature">
        <el-input v-model="dkform.bodyTemperature"></el-input>
      </el-form-item>

      <el-form-item label="打卡时间" prop="checkOutDate">
        <el-date-picker
          type="date"
          value-format="yyyy-MM-dd"
          style="width: 100%"
          v-model="dkform.checkOutDate"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="是否到过中高风险地区" prop="isToHighArea">
        <el-input v-model="dkform.isToHighArea"></el-input>
      </el-form-item>
      <el-form-item label="是否接触过疑似确诊" prop="isTouch">
        <el-input v-model="dkform.isTouch"></el-input>
      </el-form-item>
      <el-form-item label="备注" prop="remarks">
        <el-input v-model="dkform.remarks"></el-input>
      </el-form-item>
      <el-button type="primary" @click="baocun">保存</el-button>
    </el-form>
  </div>
</template>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=1GpAVwuZKZ8r4YGKSnfmtcz92W5ohBqG"></script>
<script>
import requset from "@/utils/request";
export default {
  data() {
    return {
      dkform: {},
    };
  },
  mounted() {},
  methods: {
    async baocun() {
      const res = await requset.post("/rydk/add", this.dkform);
      console.log(res);
      if (res.data.code == 200) {
        this.$message.success("保存成功");
        this.dkform = {};
      }
    },
  },
};
</script>
<style>
.firn .el-form-item {
  width: 50%;
  float: left;
}
</style>